/*
 * Copyright (c) 2020-2099 the original author or authors. All rights reserve.
 */
package org.tianyun.cloud.common.dto;

import java.util.List;

/**
 * 节点树
 *
 * @auther ebert_chan
 */
public class Node<T> {

    /**
     * 节点ID
     */
    private T id;

    /**
     * 父节点ID
     */
    private T pid;

    /**
     * 显示名称
     */
    private String name;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 子节点列表
     */
    private List<Node<T>> childrens;

    public Node() {
    }

    public Node(T id, T pid, String name, Integer sort) {
        super();
        this.id = id;
        this.pid = pid;
        this.name = name;
        this.sort = sort;
    }

    public T getId() {
        return id;
    }

    public void setId(T id) {
        this.id = id;
    }

    public T getPid() {
        return pid;
    }

    public void setPid(T pid) {
        this.pid = pid;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Node<T>> getChildrens() {
        return childrens;
    }

    public void setChildrens(List<Node<T>> childrens) {
        this.childrens = childrens;
    }

    @Override
    public String toString() {
        return this.id + "|" + this.name;
    }

}
